package com.qfedu.ssm.controllers;

import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class GlobalExceptionController {
    @ExceptionHandler
    public String doException(Exception e){
        if(e instanceof UnauthorizedException){
            return "/lesspermission.jsp";
        }else if (e instanceof  NullPointerException){
            return "";
        }
        return null;
    }
}
